#include <ros/ros.h>
#include <study2/mysrv.h>

bool callback(study2::mysrv::Request &request, study2::mysrv::Response &response) {
    ROS_INFO("callback");
    response.name = request.name;
    return true;
}

int main(int argc, char **argv) noexcept {
    ros::init(argc, argv, "server");
    ros::NodeHandle node_handle;

    ros::ServiceServer service_server = node_handle.advertiseService(
        "/spawn", callback
    );

    // while (ros::ok()) {
    //     ros::spinOnce();
    // }
    ros::spin();

    return 0;
}
